package com.nondo.rdp.finance.service.impl.analysis;

import com.nondo.rdp.auth.domain.User;
import com.nondo.rdp.finance.domain.analysis.AnalysisComment;
import com.nondo.rdp.finance.domain.analysis.AnalysisCommentUp;
import com.nondo.rdp.finance.repository.analysis.AnalysisCommentUpRepository;
import com.nondo.rdp.finance.service.analysis.AnalysisCommentUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service
public class AnalysisCommentUpServiceImpl implements AnalysisCommentUpService {
    @Autowired
    AnalysisCommentUpRepository analysisCommentUpRepository;

    @Override
    public AnalysisCommentUp findOne(Long id) {
        return this.analysisCommentUpRepository.findOne(id);
    }

    @Override
    public AnalysisCommentUp save(AnalysisCommentUp analysisCommentUp) {
        return this.analysisCommentUpRepository.save(analysisCommentUp);
    }

    @Override
    public void delete(Long id) {
        this.analysisCommentUpRepository.deleteById(id);
    }

    @Override
    public AnalysisCommentUp findByAnalysisCommentAndUser(AnalysisComment analysisComment, User user) {
        return this.analysisCommentUpRepository.findByAnalysisCommentAndUser(analysisComment, user);
    }
}